package com.beici.waterghost.utils;

import com.beici.waterghost.except.selectError;
import com.beici.waterghost.model.resultes;

import java.util.List;

/**
 * 取正工具，正确返回true，否则返回false
 */
public class takeUtils {

    /**
     * 校验插入数据时是否插入成功
     * @param count 插入返回值
     * @return  结果
     */
    public static boolean vefitiyINSERT(int count){
        if (count<=0){
            return false;
        }
        return true;
    }

    public static Object verfitySelect(Object o){
        if (o instanceof List){
            if (((List)o).size()<=0){
                throw new selectError("空");
            }
        }
        if (o==null){
            throw new selectError("空");
        }
        return o;

    }

    public static boolean StringIsNullOrEmpty(String s){
        if (s==null||s.equals("")||s.length()<=0){
            return false;
        }
        return true;
    }

}
